package com.wlyuan.index.domain.source.valueobj;

import com.wlyuan.core.domain.valueobj.CarrierId;
import com.wlyuan.core.domain.valueobj.TenantId;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;

@AllArgsConstructor
@Getter
@ToString
public final class Carrier {
    private CarrierId carrierId;
    private String name;
    private String abbr;
    private CarrierType type;
    private String contactName;
    private String contactMobile;
    private TenantId tenantId;

    public boolean online() {
        return type == CarrierType.ONLINE;
    }

    public static boolean online(Integer type) {
        return CarrierType.valueOf(type) == CarrierType.ONLINE;
    }
}
